<?php
/* 
    Project     : 48c6c450f1a4a0cc53d9585dc0fee742
    Created on  : Mar 16, 2013, 11:29:15 PM
    Author      : Truong Khuong - khuongxuantruong@gmail.com
    Description :
        Purpose of the stylesheet follows.
*/
class category_model extends Backend_Model {

    function __construct()
    {
        parent::__construct('categories','cate');
		
    }
    function gets($type=null){
        if($type!=null)$this->db->where('cate_type',$type);
        $query=$this->db
                ->where('cate_status','true')
                ->order_by('cate_parent', 'ASC')
                ->order_by('cate_position', 'ASC')
                ->order_by('cate_insert', 'DESC')
                ->get('categories');
        return $query->result();
    }
    
}
